/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package judf.reporte.jasper;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;

/**
 *
 * @author Frank
 */
public class Reporte {

    public static JasperPrint generarReporte( String reporte, Map parametros, Connection cn ) throws SQLException, JRException {
        JasperReport report = (JasperReport) JRLoader.loadObject(Reporte.class.getResource(reporte));
        return JasperFillManager.fillReport( report, parametros, cn );
    }

}
